//
//  DCAComputation.h
//  DCA
//
//  Created by James Critchley on 8/15/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//


#ifndef _DCACOMPUTATION_H_
#define _DCACOMPUTATION_H_

#include "Sys3D.h"

class DCAComputation
{
public:
    DCAComputation():calcH2(true),calcH1(true){}
    
    bool calcH2;
    bool calcH1;
    bool calc_pinvjac;
    
    virtual void kinAssembly()=0;
    virtual void kinSolve()=0;
    virtual void comp_null() = 0;
    virtual void assemble() = 0;  // the local assembly operation
    virtual void solve() = 0;     // the local solve operation    
};


class DCABasic : public DCAComputation
{
public:
    RSIM::Sys3D *mbs3D;
    int child_id;
    int parent_id;
    int asm_id;
    
    DCABasic(){};
    virtual ~DCABasic(){
            cout<<"Destroying class DCABasic\n";
    };
    
    virtual void kinAssembly(){}
    virtual void kinSolve(){}
    virtual void comp_null(){}
    virtual void assemble();  // the local assembly operation
    virtual void solve();     // the local solve operation    
};

class DCARoot : public DCAComputation
{
public:
    RSIM::Sys3D *mbs3D;
    int child_id;
    int parent_id;
    int asm_id;

    DCARoot(){};
    virtual ~DCARoot(){
            cout<<"Destroying class DCARoot\n";
    };
        
    virtual void kinAssembly(){}
    virtual void kinSolve();
    virtual void comp_null(){}
    virtual void assemble();  // the local assembly operation
    virtual void solve();     // the local solve operation    
};

class DCAABA : public DCAComputation
{
public:
    RSIM::Sys3D *mbs3D;
    int start_id;
    int end_id;
    int asm_id;
    
    int eom_startid;
    int eom_endid;
    
    int kin_startid;
    int kin_endid;

    DCAABA(){};
    virtual ~DCAABA(){};
    
    // HERE
    virtual void kinAssembly();
    virtual void kinSolve();
    virtual void comp_null();
    virtual void assemble();  // the local assembly operation
    virtual void solve();     // the local solve operation    
};

class DCA : public DCAComputation
{
public:
    RSIM::Sys3D *mbs3D;
    int start_id;
    int end_id;
    int start_asm;
    int dis_start;
    int dis_end;        
    
    int kin_startid;
    int kin_endid;

    DCA(){};
    virtual ~DCA(){
            cout<<"Destroying class DCA\n";
    };
        
    virtual void kinAssembly(){}
    virtual void kinSolve(){}
    virtual void comp_null(){}
    virtual void assemble();  // the local assembly operation
    virtual void solve();     // the local solve operation    
};

class DCATerminalABA : public DCAComputation
{
public:
    RSIM::Sys3D *mbs3D;
    int start_id;
    int end_id;
    int asm_id;    

    DCATerminalABA(){};
    virtual ~DCATerminalABA(){};
    
    virtual void kinAssembly();
    virtual void kinSolve();
    // virtual void formEOM();
    virtual void assemble();  // the local assembly operation
    virtual void solve();     // the local solve operation    
};

#endif
